<script lang="ts" setup>
const props = withDefaults(defineProps<Props>(), {
  disabled: false,
  direction: "horizontal",
});
interface Props {
  modelValue: any;
  /**禁用全部 */
  disabled?: boolean;
  /**排列方式 */
  direction?: "horizontal" | "vertical";
}
const emit = defineEmits<{
  (e: "change", value: any): void;
  (e: "update:modelValue", value: any): void;
}>();
const $modelValue = computed({
  get() {
    return props.modelValue;
  },
  set(value: any) {
    emit("update:modelValue", value);
  },
});
</script>

<template>
  <VanRadioGroup
    :direction="props.direction"
    :disabled="props.disabled"
    v-model="$modelValue"
    @change="(e) => emit('change', e)"
    class="RadioBtnGroup auto-ML-xs"
  >
    <slot></slot>
  </VanRadioGroup>
</template>

<style lang="less" scoped>
.RadioBtnGroup {
  justify-content: space-around;
}
</style>
